package com.live.dengdengtv.activity.msg;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.live.dengdengtv.CustomTitleActivity;
import com.live.dengdengtv.R;
import com.live.dengdengtv.fragment.ChatFragment;
import com.live.dengdengtv.fragment.ConversationItemClick;
import com.live.dengdengtv.fragment.MsgFragment;

public class MyMsgActivity extends CustomTitleActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.framelayout, R.layout.title_custom_red);
        setDefaultTitle("我的消息");

        MsgFragment fragment = new MsgFragment();
        fragment.setArguments(getIntent().getExtras());
        fragment.setOnItemClickListener(new ConversationItemClick() {
            @Override
            public void onConversationItemClick(String id) {
                Intent intent = new Intent(context,ChatRoomActivity.class);
                intent.putExtra(ChatFragment.C2C_ID, id);
                startActivity(intent);
            }
        });
        getSupportFragmentManager().beginTransaction()
                .add(R.id.fragment_container, fragment).commit();

    }

    @Override
    public void onClick(View v) {

    }
}
